package ch.exm.storm.conditions;


public class GreaterThan extends TwoArgumentsCondition {

	public GreaterThan(Object first, Object second) {
		super(first, second);
	}
	
	@Override
	public boolean matches(Object firstValue, Object secondValue) {
		if (firstValue == null || secondValue == null) return false;
		if (!(firstValue instanceof Comparable) || !(secondValue instanceof Comparable)) return false;
		return ((Comparable)firstValue).compareTo(secondValue) > 0;
	}

	@Override
	protected String getConditionKeyword() {
		return (" > ");
	}
	
	@Override
	protected String getInverseConditionKeyword() {
		return (" <= ");
	}
	
	public static GreaterThan isGreaterThan(Object first, Object second) {
		return new GreaterThan(first, second);
	}
}

